package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Zspecifications {
    private int onsId;
    private String onsName;
    private Collection<Zspecificationsvalue> zspecificationsvaluesByOnsId;

    @Id
    @Column(name = "ons_id")
    public int getOnsId() {
        return onsId;
    }

    public void setOnsId(int onsId) {
        this.onsId = onsId;
    }

    @Basic
    @Column(name = "ons_name")
    public String getOnsName() {
        return onsName;
    }

    public void setOnsName(String onsName) {
        this.onsName = onsName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Zspecifications that = (Zspecifications) o;
        return onsId == that.onsId &&
                Objects.equals(onsName, that.onsName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(onsId, onsName);
    }

    @OneToMany(mappedBy = "zspecificationsByOnsId")
    public Collection<Zspecificationsvalue> getZspecificationsvaluesByOnsId() {
        return zspecificationsvaluesByOnsId;
    }

    public void setZspecificationsvaluesByOnsId(Collection<Zspecificationsvalue> zspecificationsvaluesByOnsId) {
        this.zspecificationsvaluesByOnsId = zspecificationsvaluesByOnsId;
    }
}
